package org.java.dao.DaoImpl;

import org.java.dao.ArtRecommendsDao;
import org.java.entity.Goods;
import org.java.entity.Recommends;
import org.java.util.JDBCUtil;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class RecommendsDaoImpl implements ArtRecommendsDao {
    private JdbcTemplate jdbcTemplate=new JdbcTemplate(JDBCUtil.getDataSource());
    @Override
    public List<Recommends> getRecommendsList() {
        String sql="SELECT rpic,rnaeme,pprice FROM recommends";
        return jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(Recommends.class));
    }
}
